{% if is_paginated %}

<div class="text-center">
<ul class="pagination">
    {% if page_obj.has_previous %}
        <li><a href="?page={{ page_obj.previous_page_number }}{{ getvars }}{{ hashtag }}" class="prev">前一页</a></li>
    {% else %}
        <li class="disabled"><a href="#">前一页</a></li>
    {% endif %}
    {% for page in pages %}
        {% if page %}
            {% ifequal page page_obj.number %}
                <li class="active"><a href="#">{{ page }}</a></li>
            {% else %}
                <li><a href="?page={{ page }}{{ getvars }}{{ hashtag }}">{{ page }}</a></li>
            {% endifequal %}
        {% else %}
            <li><span>...</span></li>
        {% endif %}
    {% endfor %}
    {% if page_obj.has_next %}
        <li><a href="?page={{ page_obj.next_page_number }}{{ getvars }}{{ hashtag }}" class="next">后一页</a></li>
    {% else %}
        <li class="disabled"><a href="#">后一页</a></li>
    {% endif %}
</ul>
</div>
{% endif %}
